﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="edit2.aspx.cs" Inherits="org_manUser_edit2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>编辑账号</title>
    <link href="../../css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div id="content">
        <asp:SqlDataSource ID="sds_users" runat="server" 
            ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
            DeleteCommand="DELETE FROM [users] WHERE [userid] = @userid" 
            InsertCommand="INSERT INTO [users] ([username], [realname], [sex], [email], [mphone], [phone], [address], [postcode], [organizationid], [description]) VALUES (@username, @realname, @sex, @email, @mphone, @phone, @address, @postcode, @organizationid, @description)" 
            SelectCommand="SELECT * FROM [users] WHERE ([username] = @username)" 
            UpdateCommand="UPDATE [users] SET [realname] = @realname, [sex] = @sex, [email] = @email, [mphone] = @mphone, [phone] = @phone, [address] = @address, [postcode] = @postcode, [description] = @description WHERE [userid] = @userid">
            <SelectParameters>
                <asp:QueryStringParameter Name="username" QueryStringField="un" Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="userid" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="username" Type="String" />
                <asp:Parameter Name="realname" Type="String" />
                <asp:Parameter Name="sex" Type="String" />
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="mphone" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="postcode" Type="String" />
                <asp:Parameter Name="organizationid" Type="Int32" />
                <asp:Parameter Name="description" Type="String" />
                <asp:Parameter Name="userid" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="username" Type="String" />
                <asp:Parameter Name="realname" Type="String" />
                <asp:Parameter Name="sex" Type="String" />
                <asp:Parameter Name="email" Type="String" />
                <asp:Parameter Name="mphone" Type="String" />
                <asp:Parameter Name="phone" Type="String" />
                <asp:Parameter Name="address" Type="String" />
                <asp:Parameter Name="postcode" Type="String" />
                <asp:Parameter Name="organizationid" Type="Int32" />
                <asp:Parameter Name="description" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="sds_login" runat="server" 
            ConnectionString="<%$ ConnectionStrings:appConnectionString %>" 
            DeleteCommand="DELETE FROM [login] WHERE [username] = @username" 
            InsertCommand="INSERT INTO [login] ([username], [password], [available]) VALUES (@username, @password, @available)" 
            SelectCommand="SELECT * FROM [login] WHERE ([username] = @username)" 
            UpdateCommand="UPDATE [login] SET [password] = @password WHERE [username] = @username">
            <SelectParameters>
                <asp:QueryStringParameter Name="username" QueryStringField="un" Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="username" Type="String" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="password" Type="String" />
                <asp:Parameter Name="available" Type="String" />
                <asp:Parameter Name="username" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="username" Type="String" />
                <asp:Parameter Name="password" Type="String" />
                <asp:Parameter Name="available" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" 
            CellPadding="3" DataKeyNames="username" DataSourceID="sds_login" 
            GridLines="Horizontal" Height="50px" Width="450px">
            <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
            <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
            <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
            <Fields>
                <asp:BoundField DataField="username" HeaderText="用户名" ReadOnly="True" 
                    SortExpression="username" />
                <asp:BoundField DataField="password" HeaderText="密码" 
                    SortExpression="password" />
                <asp:CommandField EditText="&lt;img alt='' border='0' src='../../images/modi...gif' /&gt;点击修改密码" 
                    ShowEditButton="True" />
            </Fields>
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
            <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
            <AlternatingRowStyle BackColor="#F7F7F7" />
        </asp:DetailsView>
        <asp:DetailsView ID="DetailsView2" runat="server" AutoGenerateRows="False" 
            BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" 
            CellPadding="3" DataKeyNames="userid" DataSourceID="sds_users" 
            GridLines="Horizontal" Height="50px" Width="450px">
            <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
            <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
            <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
            <Fields>
                <asp:BoundField DataField="userid" HeaderText="用户ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="userid" />
                <asp:BoundField DataField="username" HeaderText="用户名" ReadOnly="True" 
                    SortExpression="username" />
                <asp:BoundField DataField="realname" HeaderText="真实姓名" 
                    SortExpression="realname" />
                <asp:BoundField DataField="sex" HeaderText="性别" SortExpression="sex" />
                <asp:BoundField DataField="email" HeaderText="E-mail" SortExpression="email" />
                <asp:BoundField DataField="mphone" HeaderText="手机号码" SortExpression="mphone" />
                <asp:BoundField DataField="phone" HeaderText="单位电话号码" SortExpression="phone" />
                <asp:BoundField DataField="address" HeaderText="住址" SortExpression="address" />
                <asp:BoundField DataField="postcode" HeaderText="邮编" 
                    SortExpression="postcode" />
                <asp:BoundField DataField="organizationid" HeaderText="所属组织ID" ReadOnly="True" 
                    SortExpression="organizationid" />
                <asp:BoundField DataField="description" HeaderText="描述" 
                    SortExpression="description" />
                <asp:CommandField EditText="&lt;img src='../../images/modi...gif' alt='' border='0' /&gt;点击修改用户信息" 
                    ShowEditButton="True" />
            </Fields>
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
            <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
            <AlternatingRowStyle BackColor="#F7F7F7" />
        </asp:DetailsView>
        </div>
    </div>
    </form>
</body>
</html>
